1. Field of the Invention
The present invention relates to computer systems, and more specifically, to management of destage tasks in a storage controller.
2. Description of the Related Art
High end storage controllers, such as the International Business Machines Corporation (IBM®) Enterprise Storage Server manage Input/Output (I/O) requests from networked hosts to a pool of storage devices, such as a direct access storage device (DASD), Redundant Array of Independent Disks (RAID Array), and Just a Bunch of Disks (JBOD). Storage controllers include one or more host bus adapter (HBA) cards to communicate with one or more hosts over a network and device adapters (DAs) to communicate with the storage devices. The storage controllers also include a cache memory and a non-volatile storage device (WS), which may be comprised of a battery backed-up random access memory.
Caching is a fundamental technique in hiding I/O latency and is widely used in storage controllers, file systems, and operating systems. The Storage Networking Industry Association (SNIA) defines a cache as “a high speed memory or storage device used to reduce the effective time required to read data from or write data to a lower speed memory or device.” Hereinafter, cache techniques will be discussed in the context of a storage controller wherein fast, but relatively expensive, random access memory is used as a cache for slow, but relatively inexpensive, disks or storage devices. The cache memory is used for rapid access to data inpaged (staged) from external storage to service read data access requests from memory and to provide buffering of modified data. Write requests are written to the cache and mirrored in the NVS and then written (destaged) to the external storage devices.
Read cache management is a well-studied discipline. There are a large number of cache replacement techniques in this context, see, for example, LRU, CLOCK, FBR, LRU-2, 2Q, LRFU, LIRS, MQ, ARC, and CAR.
Write cache management is a developing discipline. NVS was introduced to enable fast writes. Generally, in the absence of NVS, every data write must be synchronously written (destaged) directly to the storage device to ensure consistency, correctness, durability, and persistence. Otherwise failure of the server may lose cache and result in a loss of data. Generally the rate of host writes exceeds the speed of the storage devices, hence without NVS data transfer would bottleneck. NVS enables fast writes to cache wherein the writes are mirrored to and stored safely in the NVS until transfer to the external storage device. The data is destaged from cache later (and discarded from NVS) in an asynchronous fashion thus hiding the write latency of the storage device. The cache and NVS typically store updates intended for multiple storage devices. To guarantee continued low latency for writes, the data in the NVS must typically be drained so as to ensure that there is always some empty space for incoming writes; otherwise, follow-on writes will become effectively synchronous, which may adversely impact the response time for host writes. On the other hand, if the writes are drained too aggressively, then one generally cannot fully exploit the benefits of write caching since the average amount of NVS cache utilized will be typically low. Cache is cheaper and much bigger than NVS so NVS is the bottleneck in destaging of write data.
Some destaging techniques use a linear thresholding scheme that limits the occupancy of the NVS for a particular storage device to prevent failure of a single storage device from affecting all of the devices. Other techniques dynamically vary the rate of destages to storage devices based on the overall occupancy of the NVS and the occupancy associated with each storage device. Writing at full throttle regardless of the rate of new writes, is generally non-ideal for performance and reduces the maximum write throughput obtainable from the storage controller. Desired behavior is simply to keep up with the incoming write load (i.e., write requests) while keeping the NVS largely occupied without filling up the NVS. The higher the NVS occupancy the more effective the write cache is, as it can absorb more writes to the same logical addresses, hence the more efficient the throughput of data to the storage devices.